<form nz-form>
  <nz-form-item>
    <nz-form-label [nzSpan]="5" nzFor="email"><b>用户名</b></nz-form-label>
    <nz-form-control [nzSpan]="14">
      <span>{{userInfo.name}}</span>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="5" nzFor="email"><b>邮箱</b></nz-form-label>
    <nz-form-control [nzSpan]="14">
      <span>{{userInfo.email}}&nbsp;&nbsp;&nbsp;</span>
      <button *ngIf="userInfo.emailActivated==0" nz-button nzType="primary" nzSize="small" (click)="showVerification()">
        绑定
      </button>
      <button *ngIf="userInfo.emailActivated==1" nz-button nzType="primary" nzSize="small" (click)="showVerification()">
        激活
      </button>
      <button *ngIf="userInfo.emailActivated==2" nz-button nzType="primary" nzSize="small" (click)="showVerification()">
        修改
      </button>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="5" nzFor="email"><b>最近登录时间</b></nz-form-label>
    <nz-form-control [nzSpan]="14">
      <span>{{userInfo.lastLogin| date:'yyyy-MM-dd HH:mm:ss'}}</span>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="5" nzFor="email"><b>最近登录终端IP</b></nz-form-label>
    <nz-form-control [nzSpan]="14">
      <span>{{userInfo.lastLoginIP}}</span>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="5" nzFor="email" [nzNoColon]="true"></nz-form-label>
    <nz-form-control [nzSpan]="14">
      <button nz-button nzType="primary" nzSize="small" (click)="showResetPassword()">修改密码</button>
    </nz-form-control>
  </nz-form-item>
</form>
<nz-modal nzMaskClosable="false" [(nzVisible)]="showUpdateFlag" nzTitle="修改密码" (nzOnCancel)="handleCancel()"
          (nzOnOk)="resetPassword()">
  <ng-container *nzModalContent>
    <form nz-form>
      <nz-form-item>
        <nz-form-label [nzSpan]="5" nzRequired nzFor="email">旧密码</nz-form-label>
        <nz-form-control [nzSpan]="15">
          <input type="password" nz-input [(ngModel)]="resetInfo.oldPassword" name="resetInfo.oldPassword"/>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="5" nzRequired nzFor="email">新密码</nz-form-label>
        <nz-form-control [nzSpan]="15">
          <input type="password" nz-input [(ngModel)]="resetInfo.newPassword" name="resetInfo.newPassword"/>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="5" nzRequired nzFor="email">确认新密码</nz-form-label>
        <nz-form-control [nzSpan]="15">
          <input type="password" nz-input [(ngModel)]="resetInfo.confirmPassword" name="resetInfo.confirmPassword"/>
        </nz-form-control>
      </nz-form-item>
    </form>
  </ng-container>
</nz-modal>
<nz-modal nzMaskClosable="false" [(nzVisible)]="showVerificationFlag" nzTitle="激活/修改邮箱"
          (nzOnCancel)="showVerificationCancel()"
          (nzOnOk)="activeEmail()">
  <ng-container *nzModalContent>
    <form nz-form>
      <nz-form-item>
        <nz-form-label [nzSpan]="5" nzRequired nzFor="email">邮箱</nz-form-label>
        <nz-form-control [nzSpan]="15">
          <input nz-input [(ngModel)]="userInfo.email" name="userInfo.email"/>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="5" nzRequired nzFor="email">验证码</nz-form-label>
        <nz-form-control [nzSpan]="15">
          <input nz-input [(ngModel)]="userInfo.verificationCode" name="userInfo.verificationCode"/>
          <button [disabled]="sendButton" style="margin-top: 5px" nz-button nzType="primary" nzSize="small"
                  (click)="sendVerification()">
            获取验证码
          </button>
          <span>{{countText}}</span>
        </nz-form-control>
      </nz-form-item>
    </form>
  </ng-container>
</nz-modal>
